home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / prog / lb09c.zip / TURTLE.BAS < prev    next >
BASIC Source File  |  1992-03-09  |  1KB  |  55 lines

  1.  
  2.     ' This is a turtle graphics demo
  3.  
  4.     dim color$(4)
  5.  
  6.     color$(1) = "red"
  7.     color$(2) = "green"
  8.     color$(3) = "yellow"
  9.     color$(4) = "blue"
  10.  
  11.     print "Opening turtle.txt"
  12.     open "turtle.txt" for output as #turtleOut
  13.  
  14.     print "Writing spiral data..."
  15.  
  16.     print #turtleOut, "home"
  17.     print #turtleOut, "down"
  18.     print #turtleOut, "north"
  19.     print #turtleOut, "fill black"
  20.  
  21.     for x = 1 to 200
  22.         print #turtleOut, "color "; color$(1 + x - int(x/4) * 4)
  23.         print #turtleOut, "turn 122"
  24.         print #turtleOut, "go "; str$(x*2)
  25.     next x
  26.  
  27.     print "Closing turtle.txt" : print
  28.     close #turtleOut
  29.  
  30.     print "Opening turtle.txt"
  31.     open "turtle.txt" for input as #turtleIn
  32.  
  33.     print "Opening Graphics Window"
  34.     open "Turtle Graphics Example" for graphics_fs as #gWindow
  35.  
  36.     print "Retrieving and plotting graphics..."
  37.  
  38. [nextLine]
  39.  
  40.     input #turtleIn, text$
  41.     print #gWindow, text$
  42.  
  43.     if eof(#turtleIn) = 0 then [nextLine]
  44.  
  45.     print #gWindow, "flush"
  46.     input "Press 'Return' "; r$
  47.  
  48.     print "Closing turtle.txt"
  49.     close #turtleIn
  50.     close #gWindow
  51.  
  52.     print "Done."
  53.  
  54.  
  55.